<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>网舟营销优化平台</title>
    <link rel="stylesheet" href="${re.contextPath}/plugin/plugins/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${re.contextPath}/plugin/plugins/font-awesome/css/font-awesome.min.css" media="all"/>
    <link rel="stylesheet" href="${re.contextPath}/plugin/build/css/app.css" media="all"/>
    <link rel="stylesheet" href="${re.contextPath}/plugin/build/css/themes/default.css" media="all" id="skin" kit-skin/>
    <style>
        <#--前端无聊美化ing-->
        .layui-footer {
            background-color: #2F4056;
        }

        .layui-side-scroll {
            border-right: 3px solid #009688;
        }
    </style>
</head>

<body class="kit-theme">
<div class="layui-layout layui-layout-admin kit-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">网舟营销优化平台</div>
        <div class="layui-logo kit-logo-mobile"></div>
        <div class="layui-hide-xs">
            <ul class="layui-nav layui-layout-left kit-nav">
                <form class="layui-form layui-form-pane" hidden="true" style="margin-left: 20px;">
                    <label for="fieldName" class="layui-form-label" style="width:120px; background-color:#190d0d;">
                        选择渠道
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-nav-child" id="channelId" name="channelId" lay-verify="required">
                            <#--<option value="0">维度</option>-->
                            <#--<option value="1">量度</option>-->
                        </select>
                    </div>
                </form>
            </ul>
        </div>
        <ul class="layui-nav layui-layout-right kit-nav">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <i class="layui-icon">&#xe63f;</i> 皮肤</a>
                </a>
                <dl class="layui-nav-child skin">
                    <dd><a href="javascript:;" data-skin="default" style="color:#393D49;"><i class="layui-icon">
                        &#xe658;</i> 默认</a></dd>
                    <dd><a href="javascript:;" data-skin="orange" style="color:#ff6700;"><i class="layui-icon">
                        &#xe658;</i> 橘子橙</a></dd>
                    <dd><a href="javascript:;" data-skin="green" style="color:#00a65a;"><i class="layui-icon">
                        &#xe658;</i> 春天绿</a></dd>
                    <dd><a href="javascript:;" data-skin="pink" style="color:#FA6086;"><i class="layui-icon">
                        &#xe658;</i> 少女粉</a></dd>
                    <dd><a href="javascript:;" data-skin="blue.1" style="color:#00c0ef;"><i class="layui-icon">
                        &#xe658;</i> 天空蓝</a></dd>
                    <dd><a href="javascript:;" data-skin="red" style="color:#dd4b39;"><i class="layui-icon">&#xe658;</i>
                        枫叶红</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                <#assign currentUser = Session["curentUser"]>
                    <img src="${re.contextPath}/images/${currentUser.photo}"
                         class="layui-nav-img">${currentUser.username}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" kit-target
                           data-options="{url:'basic.html',icon:'&#xe658;',title:'基本资料',id:'966'}"><span>基本资料</span></a>
                    </dd>
                    <dd><a href="javascript:;">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="logout"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
        </ul>
    </div>

<#macro tree data start end>
    <#if (start=="start")>
    <div class="layui-side layui-nav-tree layui-bg-black kit-side">
    <div class="layui-side-scroll">
        <div class="kit-side-fold"><i class="fa fa-navicon" aria-hidden="true"></i></div>
    <ul class="layui-nav layui-nav-tree" lay-filter="kitNavbar" kit-navbar>
    </#if>
    <#list data as child>
        <#if child.children?size gt 0>
            <li class="layui-nav-item">
                <a class="" href="javascript:;"><i aria-hidden="true"
                                                   class="layui-icon">${child.icon}</i><span> ${child.name}</span></a>
                <dl class="layui-nav-child">
                    <@tree data=child.children start="" end=""/>
                </dl>
            </li>
        <#else>
            <dd>
                <a href="javascript:;" kit-target
                   data-options="{url:'${child.url}',icon:'${child.icon}',title:'${child.name}',id:'${child.num?c}'}">
                    <i class="layui-icon">${child.icon}</i><span> ${child.name}</span></a>
            </dd>
        </#if>
    </#list>
    <#if (end=="end")>
    </ul>
    </div>
    </div>
    </#if>
</#macro>
<@tree data=menu start="start" end="end"/>
    <div class="layui-body"  id="container">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63e;</i>
            请稍等...
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        2019 &copy;
        <a target="_blank" href="http://www.eship.com.cn/">网舟联合科技(北京)有限公司</a>
    </div>
</div>
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
<script src="${re.contextPath}/plugin/plugins/layui/layui.js"></script>
<script src="${re.contextPath}/plugin/tools/main.js"></script>
<script>
    layui.use('table', function () {
        var form = layui.form;
        var $ = layui.$;

        function getChannelList() {
            $.ajax({
                url: "${re.contextPath}/channel/showChannelList",
                type: "GET",
                data: {
                    page: 1,
                    limit: 5000
                },
                success: function (result) {
                    for (var i = 0; i < result.data.length; i++) {
                        var id = result.data[i].id;
                        var channelName = result.data[i].channelName;
                        $("#channelId").append(new Option(channelName, id));
                    }
                    form.render();
                }
            });
        }
        getChannelList();
    });
            window.onload=function () {
                window.channelId = $("#channelId").val();
                console.log(window.channelId);
            };


</script>
</body>

</html>
